package de.mauandmau;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class Start extends Activity {
	TextView ipText;
	static EditText ipEditText;
	Button connectionButton;

	public void onCreate(final Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ActivityRegistry.register(this);
		this.setContentView(R.layout.main);
		this.ipText = (TextView) this.findViewById(R.id.ip_text);
		this.ipText.setText("Deine IP ist " + NetworkUtils.getIp());
		ipEditText = (EditText) this.findViewById(R.id.ip_edit_text);
		ipEditText.setText(NetworkUtils.getIp());

		this.findViewById(R.id.StartButton).setOnClickListener(
				new OnClickListener() {
					public void onClick(final View pView) {
						startActivity(new Intent(Start.this, GameActivity.class));
					}
				});
	}

	public static String getIPFromEditText() {
		return ipEditText.getText().toString();
	}
}